package org.example.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.example.pojo.Worker;

/**
* @author wexx
* @description 针对表【tb_worker】的数据库操作Mapper
* @createDate 2024-11-16 13:51:31
* @Entity org.example.pojo.Worker
*/
public interface WorkerMapper {

    int deleteByPrimaryKey(Long id);

    int insert(Worker record);

    int insertSelective(Worker record);

    Worker selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Worker record);

    int updateByPrimaryKey(Worker record);
    @Select("select * FROM tb_worker WHERE id = #{id}")
    Worker selectworker(int id);
    @Insert("INSERT INTO tb_worker(name, age, sex,worker_id) "+
            "VALUES(#{name}, #{age}, #{salary},#{worker id})")
    int insertWorker(Worker worker);
    @Update("update tb_worker set name = #{name},age = #{age}"+
    "where id = #{id}")
    int updateWorker(Worker worker);
    @Delete("delete from tb_worker where id = #{id}")
    int deleteWorker(int id);
}
